define(function () {
    return function (oallbtn, obtn, goods) {
        for (let i = 0; i < oallbtn.length; i++) {
            oallbtn[i].onclick = function () {
                if (this.className === "iconfont icon-gouxuankuang2 allbtn") {
                    this.className = "iconfont icon-gouxuankuang1 allbtn";
                    for (let j = 0; j < obtn.length; j++) {
                        obtn[j].className = "iconfont icon-gouxuankuang1 btn";
                        goods[j].status = "icon-gouxuankuang1";
                        localStorage.setItem("goods", JSON.stringify(goods))
                    }
                } else if (this.className === "iconfont icon-gouxuankuang1 allbtn") {
                    this.className = "iconfont icon-gouxuankuang2 allbtn";
                    for (let j = 0; j < obtn.length; j++) {
                        obtn[j].className = "iconfont icon-gouxuankuang2 btn";
                        goods[j].status = "icon-gouxuankuang2";
                        localStorage.setItem("goods", JSON.stringify(goods))
                    }
                }
            }
        }
    }
})